home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / security / CodeSigner.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.6 KB  |  75 lines

  1. package java.security;
  2.  
  3. import java.io.Serializable;
  4. import java.security.cert.CertPath;
  5.  
  6. public final class CodeSigner implements Serializable {
  7.    private static final long serialVersionUID = 6819288105193937581L;
  8.    private CertPath signerCertPath;
  9.    private Timestamp timestamp;
  10.    private transient int myhash = -1;
  11.  
  12.    public CodeSigner(CertPath var1, Timestamp var2) {
  13.       if (var1 == null) {
  14.          throw new NullPointerException();
  15.       } else {
  16.          this.signerCertPath = var1;
  17.          this.timestamp = var2;
  18.       }
  19.    }
  20.  
  21.    public CertPath getSignerCertPath() {
  22.       return this.signerCertPath;
  23.    }
  24.  
  25.    public Timestamp getTimestamp() {
  26.       return this.timestamp;
  27.    }
  28.  
  29.    public int hashCode() {
  30.       if (this.myhash == -1) {
  31.          if (this.timestamp == null) {
  32.             this.myhash = this.signerCertPath.hashCode();
  33.          } else {
  34.             this.myhash = this.signerCertPath.hashCode() + this.timestamp.hashCode();
  35.          }
  36.       }
  37.  
  38.       return this.myhash;
  39.    }
  40.  
  41.    public boolean equals(Object var1) {
  42.       if (var1 != null && var1 instanceof CodeSigner) {
  43.          CodeSigner var2 = (CodeSigner)var1;
  44.          if (this == var2) {
  45.             return true;
  46.          } else {
  47.             Timestamp var3 = var2.getTimestamp();
  48.             if (this.timestamp == null) {
  49.                if (var3 != null) {
  50.                   return false;
  51.                }
  52.             } else if (var3 == null || !this.timestamp.equals(var3)) {
  53.                return false;
  54.             }
  55.  
  56.             return this.signerCertPath.equals(var2.getSignerCertPath());
  57.          }
  58.       } else {
  59.          return false;
  60.       }
  61.    }
  62.  
  63.    public String toString() {
  64.       StringBuffer var1 = new StringBuffer();
  65.       var1.append("(");
  66.       var1.append("Signer: " + this.signerCertPath.getCertificates().get(0));
  67.       if (this.timestamp != null) {
  68.          var1.append("timestamp: " + this.timestamp);
  69.       }
  70.  
  71.       var1.append(")");
  72.       return var1.toString();
  73.    }
  74. }
  75.